(:
  A procedure to select the contents of the "chat" interventions
:)
declare boundary-space strip;
import module namespace
    jj = "http://kumquat.emse.fr/utilitaires"
    at "jjutils.xq" ;
<display>{
let $t := $arguments[1]
let $d := doc($t)/trace/event
for $e at $p in $d
where $e[whiteboard]
return
  <item>{
    <info name="type">drew-whiteboard</info> ,
    <info name="time">{ $e/time }</info>,
    <info name="src-anchor">{
      <anchor>{
        <doc>{ $t }</doc>,
        <path>{jj:build-Path($e)}</path>
      }</anchor>
    }</info>,
    <info name="user">{string($e/@user)}</info>,
    <info name="room">{string($e/@room)}</info>,
    <info name="content">{
       node-name($e/whiteboard/*)
    }</info>,
    <info name="category">{
       if ($e/whiteboard/(changerModerateur|activationModePoli)) then
       			"Synchronisation"
       else 
            "Dessin"
    }</info>,
    <info name="whiteboard-text">{
       if ($e/whiteboard/outiltexte) then
       			string($e/whiteboard/outiltexte/@texte)
       else 
            ""
    }</info>
  }</item>
}</display>
